package org.example.erp.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 
 * @TableName sales_list
 */
@TableName(value ="sales_list")
@Data
public class SalesList implements Serializable {
    /**
     * 销售订单产品列ID
     */
    @TableId(type = IdType.AUTO)
    private Integer salesListId;

    /**
     * 产品编号
     */
    private String materialProductCode;

    /**
     * 订单编码
     */
    private Integer salesCode;

    /**
     * 订货日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date orderDate;

    /**
     * 交货日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date deliveryDate;

    /**
     * 状态
     */
    private Integer status;

    /**
     * 订货数量
     */
    private Integer quantity;

    /**
     * 单位ID
     */
    private Integer unitId;

    /**
     * 主单编码
     */
    private String masterOrderCode;

    /**
     * 客户ID
     */
    private Integer customerSuppliedId;

    /**
     * 工单编码
     */
    private String productionWorkOrderCode;

    /**
     * 备注
     */
    private String remark;

    /**
     * 规格
     */
    private String specificationAndModel;

    /**
     * 单价
     */
    private Integer price;

    /**
     * 金额
     */
    private Integer amount;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        SalesList other = (SalesList) that;
        return (this.getSalesListId() == null ? other.getSalesListId() == null : this.getSalesListId().equals(other.getSalesListId()))
            && (this.getMaterialProductCode() == null ? other.getMaterialProductCode() == null : this.getMaterialProductCode().equals(other.getMaterialProductCode()))
            && (this.getSalesCode() == null ? other.getSalesCode() == null : this.getSalesCode().equals(other.getSalesCode()))
            && (this.getOrderDate() == null ? other.getOrderDate() == null : this.getOrderDate().equals(other.getOrderDate()))
            && (this.getDeliveryDate() == null ? other.getDeliveryDate() == null : this.getDeliveryDate().equals(other.getDeliveryDate()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getQuantity() == null ? other.getQuantity() == null : this.getQuantity().equals(other.getQuantity()))
            && (this.getUnitId() == null ? other.getUnitId() == null : this.getUnitId().equals(other.getUnitId()))
            && (this.getMasterOrderCode() == null ? other.getMasterOrderCode() == null : this.getMasterOrderCode().equals(other.getMasterOrderCode()))
            && (this.getCustomerSuppliedId() == null ? other.getCustomerSuppliedId() == null : this.getCustomerSuppliedId().equals(other.getCustomerSuppliedId()))
            && (this.getProductionWorkOrderCode() == null ? other.getProductionWorkOrderCode() == null : this.getProductionWorkOrderCode().equals(other.getProductionWorkOrderCode()))
            && (this.getRemark() == null ? other.getRemark() == null : this.getRemark().equals(other.getRemark()))
            && (this.getSpecificationAndModel() == null ? other.getSpecificationAndModel() == null : this.getSpecificationAndModel().equals(other.getSpecificationAndModel()))
            && (this.getPrice() == null ? other.getPrice() == null : this.getPrice().equals(other.getPrice()))
            && (this.getAmount() == null ? other.getAmount() == null : this.getAmount().equals(other.getAmount()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getSalesListId() == null) ? 0 : getSalesListId().hashCode());
        result = prime * result + ((getMaterialProductCode() == null) ? 0 : getMaterialProductCode().hashCode());
        result = prime * result + ((getSalesCode() == null) ? 0 : getSalesCode().hashCode());
        result = prime * result + ((getOrderDate() == null) ? 0 : getOrderDate().hashCode());
        result = prime * result + ((getDeliveryDate() == null) ? 0 : getDeliveryDate().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getQuantity() == null) ? 0 : getQuantity().hashCode());
        result = prime * result + ((getUnitId() == null) ? 0 : getUnitId().hashCode());
        result = prime * result + ((getMasterOrderCode() == null) ? 0 : getMasterOrderCode().hashCode());
        result = prime * result + ((getCustomerSuppliedId() == null) ? 0 : getCustomerSuppliedId().hashCode());
        result = prime * result + ((getProductionWorkOrderCode() == null) ? 0 : getProductionWorkOrderCode().hashCode());
        result = prime * result + ((getRemark() == null) ? 0 : getRemark().hashCode());
        result = prime * result + ((getSpecificationAndModel() == null) ? 0 : getSpecificationAndModel().hashCode());
        result = prime * result + ((getPrice() == null) ? 0 : getPrice().hashCode());
        result = prime * result + ((getAmount() == null) ? 0 : getAmount().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", salesListId=").append(salesListId);
        sb.append(", materialProductCode=").append(materialProductCode);
        sb.append(", salesCode=").append(salesCode);
        sb.append(", orderDate=").append(orderDate);
        sb.append(", deliveryDate=").append(deliveryDate);
        sb.append(", status=").append(status);
        sb.append(", quantity=").append(quantity);
        sb.append(", unitId=").append(unitId);
        sb.append(", masterOrderCode=").append(masterOrderCode);
        sb.append(", customerSuppliedId=").append(customerSuppliedId);
        sb.append(", productionWorkOrderCode=").append(productionWorkOrderCode);
        sb.append(", remark=").append(remark);
        sb.append(", specificationAndModel=").append(specificationAndModel);
        sb.append(", price=").append(price);
        sb.append(", amount=").append(amount);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}